'use strict';

/**
 * @ngdoc function
 * @name jgappApp.controller:TaskDailylistCtrl
 * @description
 * # TaskDailylistCtrl
 * Controller of the jgappApp
 */
angular.module('jgappApp')
    .controller('TaskDailylistCtrl', function(DataByPage, openApi, $location, $routeParams) {
        var param = {};
        if ($routeParams.type == "date") {
            param.logDate = $routeParams.data
        } else if ($routeParams.type == "people") {
            param.userId = $routeParams.data
        } else if ($routeParams.type == "dep") {
            param.departmentId = $routeParams.data
        }
        this.initData = function() {
            this.dailylist = new DataByPage(openApi.getworklogByconditionApp, param);
        }
        this.initData();
        this.goDetail = function(item) {
            console.log(item)
            var param = {}
            param.pkId = item.pkId;
            $location.path("task/dailydetail/" + item.pkId)
        }

    });
